// 登录操作
var form =layui.form;
$(".layui-form").submit(function (e) {
    e.preventDefault()
    var fd = $(this).serialize()
    $.ajax({
        type: "post",
        url: "api/login",
        data: fd,
        success: function (res) {
            if (res.status === 0) {
                localStorage.setItem('mytoken', res.token)
                location.href = '/admin/index.html'
                
            } else {
                layer.msg(res.message)
            }
        }
    });
}) 
